class CreateProjects < ActiveRecord::Migration
  def self.up
    create_table :projects do |t|
      # for all projects
      t.integer :id
      t.string  :type

      # for local projects
      t.string  :name, :limit => 50, :default => ''
      t.string  :description, :deafult => ''
      t.boolean :open, :default => false

      # for remote projects
      t.string  :remote_key

      t.timestamps
    end

    add_column :issues, :project_id, :integer
    add_column :issues, :local_id, :integer
  end

  def self.down
    drop_table :projects
  end
end
